<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>文档标题</title>
    <script>
      function jie_cheng(num) {
        if (num === 1) {
          return 1;
        }
        return num * jie_cheng(num - 1);
      }

      function caculate(num) {
        if (num === 1) {
          return jie_cheng(1);
        }
        return jie_cheng(num) + caculate(num - 1);
      }

      const num = prompt("请输入一个正整数");
      alert(`结果为 ${caculate(num)}`)
    </script>
</head>
<body>
<h1>我的第一个HTML页面</h1>
<p>我的第一个段落。</p>
</body>
</html>
